use json::{JsonValue, object::Object};


//人脸数据
pub struct FaceData {
    face_id: String, //id
    picture: String, // 图片的base64
}
///实现Into<JsonValue>
impl Into<JsonValue> for FaceData {
    fn into(self) -> JsonValue {
        let mut obj: Object = Object::new();
        obj.insert("face_id", JsonValue::String(self.face_id));
        obj.insert("picture", JsonValue::String(self.picture));
        json::JsonValue::Object(obj)
    }
}

impl FaceData{

    pub fn new(face_id: String, picture: String)->Self {
        FaceData {face_id, picture}
    }
}
